//
//  KnowledgViewController.m
//  iread
//
//  Created by 朱经扬 on 15/12/16.
//  Copyright © 2015年 朱经扬. All rights reserved.
//

#import "KnowledgViewController.h"
#import "KnowledgTableViewCell.h"

@interface KnowledgViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic ,retain)UILabel *headerLabel;
@end

@implementation KnowledgViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark -      -------  TableView Delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 7;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *ID = @"knowledgCell";
    KnowledgTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(!cell) {
        cell = [[KnowledgTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }

    
    return cell;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(SCREEN_PX*0, SCREEN_PX*0, SCREEN_PX*300, SCREEN_PX*50)];
    view.backgroundColor = [UIColor whiteColor];
    
    self.headerLabel = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_PX*0, SCREEN_PX*0, SCREEN_PX*300, SCREEN_PX*50)];
    self.headerLabel.text = @"   技术科学";
    self.headerLabel.font = [UIFont boldSystemFontOfSize:14];
    self.headerLabel.backgroundColor = [UIColor whiteColor];
    [view addSubview:self.headerLabel];
    
    UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(SCREEN_PX*5, SCREEN_PX*49, SCREEN_PX*310, SCREEN_PX*1)];
    lineview.backgroundColor = [UIColor blackColor];
    lineview.alpha = 0.3;
    [view addSubview:lineview];
    return view;
}


@end
